import * as _ from 'lodash';
import { SkillItem, sprite } from '../myinterface';
export const atkComputed = (
  attr: sprite,
  skillItem: SkillItem,
  boss?: sprite,
) => {
  let atk = attr.attr.currAttr.atk; //读取人物伤害
  let skillAtk = skillItem.power;
  if (skillAtk == 0) return 0;
  let a = 1 + (_.random(0, 4) - 2) / 10; //取值范围就是 0.8-1.2
  atk = Math.trunc(atk * (1 + skillAtk / 10) * a);
  if (atk > 1) return atk;
  return 1;
};
